﻿using System.Windows.Media.Animation;

namespace 单例模式
{
    //sealed 修饰的类不能被继承
   public sealed class Single
    {
       private Single()
       {
           
       }
        //静态初始化
        //private static readonly Single GetSingle=new Single();

        //public static Single InstancSingle()
        //{
        //    return GetSingle;
        //}


        /// <summary>
        /// 现版本
        /// </summary>
        public static Single Default { get; } = new Single();



       // //延迟初始化
       // public static Single InstancSingle()
       //{
       //    return Nested.Instance;
       //}
       // public class Nested
       // {
       //     static Nested()
       //     {

       //     }
       //     internal static readonly Single Instance = new Single();
       // }
    }


}
